<?php
/**
 * @author ANHTAM
 */
include_once(DOCUMENT_ROOT . "/lib/core/BaseProcess.class.php");
class SanphamCategory extends BaseProcess {
	public function __construct() {
		parent::__construct("sp_category");
		$this->primaryKeyName = "id";
	}
	
	public function getListAll($danhmuc_id = '') {
		if ($danhmuc_id != '') {
			$sql = "SELECT id, name FROM " . $this->tableName. " WHERE danhmuc_id='" . $danhmuc_id . "' ORDER BY seq DESC";
		} else {
			$sql = "SELECT id, name FROM " . $this->tableName. " ORDER BY seq DESC";
		}
		$rs = $this->execute($sql, ADODB_FETCH_ASSOC);
        $data = array();
        if ($rs) {
            while (! $rs->EOF && $item = $rs->FetchRow()) {
                $data[] = $item;
            }
        }
        return $data;
	}
}
?>